const mysql = require('mysql');

var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'root',
    database:'demhem'
})

connection.connect();

connection.query('update student set name=?,age=?,money=? where id = ?',['小三','100','1000',5],(error, result) => {
    if(error) {
        console.log(error);
        console.log('错误');
    }
    if(result.affectedRows == 1){
        console.log('update 成功')
    }
    console.log('result === >',result);
})
connection.end();